﻿using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Text;

namespace 方法定义
{
    class major
    {

        //数据：定义了六个字段
        public string name;
        public double sum;
        public double vegetables;
        public double meat;
        public double fruits;
        public double milk;

        

        //功能:三个方法
        public void Eat()
        {
            Console.WriteLine("我叫{0}，我上午买了蔬菜，花了：{1}元", name, vegetables);
        }

        public void Drink()
        {
            Console.WriteLine("我叫{0}，我下午买了牛奶，花了：{1}元", name, milk);
        }

        public void Eating()
        {
            Console.WriteLine("我叫{0}，我晚上买了牛肉，花了：{1}元", name, meat);
        }

        public void Enjoy()
        {
            Console.WriteLine("我叫{0}，我早上买了水果，花了：{1}元", name, fruits);
        }
        public void Spend()
        {
            Console.WriteLine("我叫{0}，我今天一共花费了：{1}元",name,vegetables + meat + milk + fruits);
        }
    }
}
